import cv2

if __name__ == '__main__':
    cv2.namedWindow('img', cv2.WINDOW_NORMAL)
    cv2.resizeWindow('img', 500, 500)
    img = cv2.imread('./images/1.jpg')
    while 1:
        cv2.imshow('img', img)
        key = cv2.waitKey(0)
        if key & 0xFF == ord('q'):
            print("销毁窗口")
            cv2.imwrite("images/6666.jpg", img)
            break
    cv2.destroyAllWindows()